[Enhancement] support del files and cloud native index recover for shared-data pk table #52707
+231
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I'm doing:
Primary key table recover is used for the case that PK table meet inconsistent issue, error message like:
and we need to auto recover from this issue by rebuild PK index and delete vector.
But in current implementation, it doesn't support:
So in this PR we want to fix these.
What I'm doing:
This pull request includes several enhancements and bug fixes related to the primary key recovery mechanism in the shared-data mode. The changes include improvements to PK table recover capability, the addition of test hooks for recovery scenarios, and updates to unit tests to cover new recovery cases.
Enhancements to metadata handling:
be/src/storage/lake/lake_primary_key_recover.cpp
: Added handling for SSTable metadata in thepre_cleanup
method and improved iterator handling for del files during rowset iteration. [1] [2]Addition of test hooks:
be/src/storage/lake/meta_file.cpp
: Introduced a test hook inMetaFileBuilder::update_num_del_stat
to set a recovery flag for testing recovery mode.be/src/storage/lake/update_manager.cpp
: Added a test hook inUpdateManager::publish_primary_key_tablet
to set a recovery flag for testing recovery mode.Updates to unit tests:
be/test/storage/lake/primary_key_publish_test.cpp
: Expanded theLakePrimaryKeyPublishTest
with new test cases to cover various recovery scenarios, including recovery with multiple reasons and handling of del files. [1] [2]What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: